#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>


int main(){
    printf("execve程序进程%d执行\n",getpid());
    pid_t pid=fork();
    if(pid>0){
        printf("父进程%d执行\n",getpid());
    }
    else if(pid==0){
        printf("子进程%d执行\n",getpid());
        char *argv[]={"/home/ming/桌面/linux_app/_Process/other",NULL};
        int result=execve(argv[0],argv,NULL);
        if(result==-1){
            perror("execve");
            exit(EXIT_FAILURE);
        };
    }
    else{
        perror("创建子进程失败");
        return 1;
    }

    return 0;
    
}